package com.test5;

/****
 * 停止线程
 *interrupt
 */
class StopThread implements Runnable {
	private boolean flag = true;

	@Override
	public synchronized void run() {
		while (flag) {
			try {
				wait();
			} catch (Exception e) {
				stopThread();
			}
			System.out.println("thread run..");
		}

	}

	/**
	 * @methodDesc: 功能描述:(停止线程)
	 */
	public void stopThread() {
		flag = false;
	}

}
